-- GENERATED SPELL FOR [Atal'ai Witch Doctor] --


function spell0_5259(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(12058,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5259', 3000, 1)
end

function spell1_5259(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(11986,pUnit)
pUnit:RegisterEvent('Sorts_5259', 3000, 1)
end

function spell2_5259(pUnit, Event) --@Hex,n/a--
pUnit:FullCastSpellOnTarget(11641,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5259', 10335, 1)
end

function spell3_5259(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(9532,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5259', 3000, 1)
end

function Sorts_5259(pUnit, Event)
local choix_sorts_5259 = math.random(0, 3)
if choix_sorts_5259 == 0 then
pUnit:RegisterEvent('spell0_5259', 1, 1)
end
if choix_sorts_5259 == 1 then
pUnit:RegisterEvent('spell1_5259', 1, 1)
end
if choix_sorts_5259 == 2 then
pUnit:RegisterEvent('spell2_5259', 1, 1)
end
if choix_sorts_5259 == 3 then
pUnit:RegisterEvent('spell3_5259', 1, 1)
end
end

function mob5259_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5259', math.random(1500, 3000), 1)
end

function mob5259_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5259_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5259_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5259, 1, 'mob5259_Action')
RegisterUnitEvent(5259, 2, 'mob5259_Leave')
RegisterUnitEvent(5259, 3, 'mob5259_Kill')
RegisterUnitEvent(5259, 4, 'mob5259_Die')
